﻿namespace SilenthinkContract.Component
{
    public sealed class SkResult<T>
    {
        /// <summary>
        /// 当Status为true表示正常,false为不正常
        /// </summary>
        public bool Status { get; set; }
        /// <summary>
        /// 信息
        /// </summary>
        public string Message { get; set; }
        /// <summary>
        /// 数据
        /// </summary>
        public T Data { get; set; }
        /// <summary>
        /// 扩展数据
        /// </summary>
        public object Extra { get; set; }

        public SkResult(): this(false, string.Empty, default(T))
        {

        }

        public SkResult(bool status): this(status, string.Empty, default(T))
        {

        }

        public SkResult(T data)
            : this(false, string.Empty, data)
        {

        }

        public SkResult(bool status, T data)
            : this(status, string.Empty, data)
        {

        }

        public SkResult(bool status, string message, T data)
        {
            Status = status;
            Message = message;
            Data = data;
        }
    }
}